

public class Demo18 {
    public static void main(String[] args) {
        Object object = new Object();
        System.out.println("wait之前");
        synchronized (object) {
            try {
                object.wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        object.notify();
        System.out.println("wait之后");

    }
}
